<?php
/**
*	快捷登录使用获取登录的信息
*/
class openoauthClassAction extends openapicompanyAction
{
	public function oauthinfoAction()
	{
		$platsign	= $this->get('platsign');
		if(isempt($platsign))return returnerror('登录密钥不能为空');
		$platsign	= $this->jm->uncrypt($this->jm->base64decode($platsign));
		$plata 		= explode('@', $platsign);
		if($this->companyid!=$plata[0])return returnerror('当前密钥不是不能当前单位');
		$uid 		= arrvalue($plata,1);
		$aid 		= arrvalue($plata,2);
		$where 		= "`cid`='{$this->companyid}' and `uid`='$uid' and `id`='$aid' and `status`=1";
		$ars 		= m('usera')->getone($where,'`user`,`name`,`position`');
		if(!$ars)return returnerror('此用户单位不存在');
		
		return returnsuccess(array(
			'userinfo' => $ars
		));
	}
}	